package com.coffee.admin.service.common.dao;

import com.coffee.admin.api.common.query.SmsCodeQuery;
import com.coffee.admin.service.common.bean.SmsCode;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface SmsCodeDao {
	public SmsCode findById(Integer id);
	
	public SmsCode findByIdForUpdate(Integer id);
	
	public List<SmsCode> findByIds(@Param("idList") List<Integer> idList);

	public Integer count(@Param("param") SmsCodeQuery param);

	public List<SmsCode> page(@Param("param") SmsCodeQuery param, @Param("offset") Integer offset, @Param("rows") Integer rows);

	public SmsCode findFirst(@Param("param") SmsCodeQuery param);

	public Integer insert(SmsCode param);

	Integer insertBatch(List<SmsCode> list);

	public void updateById(@Param("param") SmsCode param);
	
	public Integer deleteById(Integer id);
	
	public Integer deleteByIds(List<Integer> idList);

	SmsCode findLastSmsCode(@Param("mobile") String mobile,
							@Param("verificationCode") String verificationCode,
							@Param("smsSource") String smsSource,
							@Param("smsCodeCreateTime") Date smsCodeCreateTime);
	
}